define(["jquery"],function($){
	var tpl = {};

	tpl.init = function(){
		var html = "";
		html += info();
		return html;
	};
	tpl.questList = function(){
		var html = "";
		html += questList();
		return html;
	};
	var info = function() {
		return 	'<script id="mabcDetail_tpl" type="html/text">'+
				'	<div class="row panel-heading">'+
				'      <div class="col-sm-3 col-md-3">'+
		  		'       	<div class="">'+
				'       		<div class="row">'+
				'          			<div class="col-sm-5 col-md-5 tx-r">科研编号：</div>'+
				'          			<div class="col-sm-7 col-md-7">{{data.hisNo||"暂未填写"}}</div>'+
				'          		</div>'+
				'       	</div>'+
		  		'    	</div>'+
		  		'      <div class="col-sm-3 col-md-3">'+
		  		'       	<div class="">'+
				'       		<div class="row">'+
				'          			<div class="col-sm-5 col-md-5 tx-r">填表日期：</div>'+
				'          			<div class="col-sm-7 col-md-7">{{data.createTime||"暂未填写"}}</div>'+
				'          		</div>'+
				'       	</div>'+
		  		'    	</div>'+
		  		'      <div class="col-sm-3 col-md-3">'+
		  		'       	<div class="">'+
				'       		<div class="row">'+
				'          			<div class="col-sm-5 col-md-5 tx-r">孩子姓名：</div>'+
				'          			<div class="col-sm-7 col-md-7">{{data.userName|| "暂未填写"}}</div>'+
				'          		</div>'+
				'       	</div>'+
		  		'    	</div>'+
		  		'      <div class="col-sm-3 col-md-3">'+
		  		'       	<div class="">'+
				'       		<div class="row">'+
				'          			<div class="col-sm-5 col-md-5 tx-r">出生日期：</div>'+
				'          			<div class="col-sm-7 col-md-7">{{data.birthday || "暂未填写"}}</div>'+
				'          		</div>'+
				'       	</div>'+
		  		'    	</div>'+
		  		' 	</div>'+
				'	<div class="row panel-heading">'+
				'		{{if data.motherName}}' +
				'      	<div class="col-sm-3 col-md-3">'+
		  		'       	<div class="">'+
				'       		<div class="row">'+
				'          			<div class="col-sm-5 col-md-5 tx-r">妈妈姓名：</div>'+
				'          			<div class="col-sm-7 col-md-7">{{data.motherName|| "暂未填写"}}</div>'+
				'          		</div>'+
				'       	</div>'+
		  		'    	</div>'+
				' 		{{/if}}'+
				'      <div class="col-sm-3 col-md-3">'+
		  		'       	<div class="">'+
				'       		<div class="row">'+
				'          			<div class="col-sm-5 col-md-5 tx-r">孩子所在学校：</div>'+
				'          			<div class="col-sm-7 col-md-7">{{data.school|| "暂未填写"}}</div>'+
				'          		</div>'+
				'       	</div>'+
		  		'    	</div>'+
		  		'      <div class="col-sm-3 col-md-3">'+
		  		'       	<div class="">'+
				'       		<div class="row">'+
				'          			<div class="col-sm-5 col-md-5 tx-r">孩子所在班级：</div>'+
				'          			<div class="col-sm-7 col-md-7 class">{{data.class || "暂未填写"}}</div>'+
				'          		</div>'+
				'       	</div>'+
				'    	</div>'+
				'		{{if data.createName}}' +  
		  		'      		<div class="col-sm-3 col-md-3">'+
		  		'       		<div class="">'+
				'       			<div class="row">'+
				'          				<div class="col-sm-5 col-md-5 tx-r">填表人：</div>'+
				'          				<div class="col-sm-7 col-md-7">{{data.createName|| "暂未填写"}}</div>'+
				'          			</div>'+
				'       		</div>'+
				'    		</div>'+
				'		{{/if}}' + 
		  		' 	</div>'+
				'</script>';
	};
	/**
	 * 渲染 MABC 问卷列表
	 * 如果 busiName 是基本资料则隐藏本行（临时弥补）
	 */
	var questList = function(){
		return 	'<script id="mabcQuestList-tpl" type="html/text">'+
					'{{each data as value,i}}'+
						'{{if value.busiName != "基本资料"}}' + 
							'<div class="row panel-heading  bs-example">'+
								'<div class="col-sm-5 col-md-5"><i class="fa fa-folder-open" aria-hidden="true"></i>&nbsp;&nbsp;{{value.busiName}}</div>'+
								'{{if value.status == "1"}}'+
									'<div class="col-sm-7 col-md-7 text-right btn-look mabcDetailBtn" busiId = "{{value.busiId}}"  answerId = "{{value.answerId}}">查看详情</div>'+
								'{{else if value.status == "0"}}'+
									'<div class="col-sm-7 col-md-7 text-right btn-look " busiId = "{{value.busiId}}"  answerId = "{{value.answerId}}">未完成</div>'+
								'{{/if}}'+
							'</div>'+ 
						'{{else}}' + 
							'<div class="row panel-heading bs-example" style="display: none;">'+
								'<div class="col-sm-5 col-md-5"><i class="fa fa-folder-open" aria-hidden="true"></i>&nbsp;&nbsp;{{value.busiName}}</div>'+
								'{{if value.status == "1"}}'+
									'<div class="col-sm-7 col-md-7 text-right btn-look mabcDetailBtn mabc7yearBaseInfo" busiId = "{{value.busiId}}"  answerId = "{{value.answerId}}">查看详情</div>'+
								'{{else if value.status == "0"}}'+
									'<div class="col-sm-7 col-md-7 text-right btn-look " busiId = "{{value.busiId}}"  answerId = "{{value.answerId}}">未完成</div>'+
								'{{/if}}'+
							'</div>'+ 
						'{{/if}}' + 
					'{{/each}}'+
				'</script>';
	}
	return tpl;
});